<%- model_class = Task -%>
<div class="page-header">
  <h1>Censor Tasks</h1>
</div>
<div class="table-responsive">
  <table class="table table-striped">
    <thead>
      <tr>
        <th><%= model_class.human_attribute_name(:name) %></th>
        <th><%= model_class.human_attribute_name(:fingers) %></th>
        <th><%= model_class.human_attribute_name(:samples) %></th>
        <th><%= model_class.human_attribute_name(:created_at) %></th>
        <th><%=t '.actions', :default => t("helpers.actions") %></th>
      </tr>
    </thead>
    <tbody>
      <% @tasks.each do |task| %>
        <tr>
          <td><%= link_to task.name, task_path(task) %></td>
          <td><%= task.num_of_fingers %></td>
          <td><%= task.num_of_samples %></td>
          <td><%= time_ago_in_words task.created_at %> ago</td>
          <td>
            <%= link_to t('.edit', :default => t("helpers.links.edit")),
                        edit_task_path(task), :class => 'btn btn-default btn-xs' %>
            <%= link_to t('.destroy', :default => t("helpers.links.destroy")),
                        task_path(task),
                        :method => :delete,
                        :data => { :confirm => t('.confirm', :default => t("helpers.links.confirm", :default => 'Are you sure?')) },
                        :class => 'btn btn-xs btn-danger' %>
          </td>
        </tr>
      <% end %>
    </tbody>
  </table>
</div>

<%= link_to t('New Tasks'),
            new_task_path,
            :class => 'btn btn-primary' %>
